/**
 * @Author: 陈瑞鹏
 * @Date:   2021-11-08 19:19:24
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-09-23 10:14:31
 */

//队列
export class Queue
{
    private items:any[] =null;

    public constructor()
    {
        this.items = [];
    }

    /**
     * 入队
     * @param data 
     */
    public push(data):boolean
    {
        if(data == null)
        {
            return false;
        }

        this.items.push(data);
        return true;
    }

    /**
     * 出队
     */
    public pop():any
    {
        return this.items.shift();
    }

    public size():number
    {
        return this.items.length;
    }

    public quere():any[]
    {
        return this.items;
    }

    public clear()
    {
        this.items = [];
    }
}